package cn.weibo.service.impl;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;


import cn.weibo.entity.UserEntity;
import cn.weibo.repository.UserRepository;
import cn.weibo.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {


    private final Logger log = LoggerFactory.getLogger(UserServiceImpl.class);

    @Resource(name = "userOfBatisRepository")
    private UserRepository userOfMybatis;

    @Resource(name = "userOfHibernateRepository")
    private UserRepository userOfHibernate;

    public void setUserOfMybatis(UserRepository userOfMybatis) {
        this.userOfMybatis = userOfMybatis;
    }

    public void setUserOfHibernate(UserRepository userOfHibernate) {
        this.userOfHibernate = userOfHibernate;
    }

    @Override
    public void insertUser(UserEntity userEntity) {
        userOfHibernate.insertUser(userEntity);
    }

    @Override
    public UserEntity getUserByAccount(String account) {
        return userOfHibernate.getUserByAccount(account);
    }

}
